package iso3.pt.model;



import org.hibernate.Session;
import org.hibernate.SessionFactory;
import org.hibernate.Transaction;
import org.hibernate.cfg.Configuration;

public class Test {

	SessionFactory sessionFactory;
	
	public Test(){
		sessionFactory = new Configuration().configure().buildSessionFactory();
	}
	
	public void inserciones1(){
    	
        Session session = sessionFactory.openSession();
        Transaction tx = session.beginTransaction();
       
        
        Profesor emp1 = new Profesor(111,1,"1234", "Asier Perallos", "12345", "perallos@eside.deusto.es","d45");
       
        
        session.save(emp1); // Se salvan los dos empleados del "dep1" en cascada

        
        tx.commit();
        session.close();
        System.out.println("Done inserciones1!");
	}
	
	 public static void main (String[] args){
		Test t1 = new Test();
	    t1.inserciones1();
	 }
}
